<?php
error_reporting(E_ALL ^ E_NOTICE);
ini_set('display_errors', 0);
require dirname(__DIR__).'/FastcgiClient.php';

$req = __DIR__.'/index.php';
var_dump($req);
$fc = new FastcgiClient('tcp://127.0.0.1:9001');
//$fc = new Fastcgi('unix:/tmp/php-fcgi.sock');
$params = array(
	'GATEWAY_INTERFACE' => 'FastCGI/1.0',
	'REQUEST_METHOD'    => 'GET',
	'SCRIPT_FILENAME'   => $req,
	'SCRIPT_NAME'       => 'index.php',
	'QUERY_STRING'      => 'a=b&c=d',
	'REQUEST_URI'       => '/hello/?a=b&c=d',
	'DOCUMENT_URI'      => $req,
	'SERVER_SOFTWARE'   => 'php/fcgiclient',
	'REMOTE_ADDR'       => '127.0.0.1',
	'REMOTE_PORT'       => '9985',
	'SERVER_ADDR'       => '127.0.0.1',
	'SERVER_PORT'       => '80',
	'SERVER_NAME'       => php_uname('n'),
	'SERVER_PROTOCOL'   => 'HTTP/1.1',
	'CONTENT_TYPE'      => '',
	'CONTENT_LENGTH'    => 0,
	'HAPN_APP_MARK'		=> 'task',
	'HTTP_HOST'			=> 'bj.jiehun.com.cn',
);
$res = $fc->request($params, false);
var_dump($res);
